package com.telecomyt.jwportal.utils;

import android.app.Activity;

import java.util.Stack;

public class ActivityManager {
    private static ActivityManager mSingleInstance;
    private ActivityManager(){
        mActivityStack = new Stack<Activity>();
    }
    public static  ActivityManager getInstance(){
        if(null==mSingleInstance){
            synchronized (ActivityManager.class){
                if(mSingleInstance==null){
                    mSingleInstance = new ActivityManager();
                }
            }
        }
        return mSingleInstance;
    }
    private Stack<Activity> mActivityStack;

    public Stack<Activity> getStack(){
        return mActivityStack;
    }


    public  void addActivity(Activity activity){
        mActivityStack.push(activity);
    }

    public  void removeActivity(Activity activity){
        mActivityStack.remove(activity);
    }


}
